VNC Viewer VCL Control for Delphi 7.0

VNC Viewer VCL Control is a independent control that realizes all the vnc viewer's function. It consists of pure Object Pascal sources without any other libraries. The Details include:

Installation


Open the "DVNC.dpk" project, and click the "install" button to install. After installation, you can find VNC Viewer Control in the "U-solution" palette.

Properties


There are several properties of the control:

Published:

Public:

 

AutoScroll

property AutoScroll: Boolean;

Description

If AutoScroll is true, the scroll bars appear automatically when necessary. For example, if the user resizes the control so that some of its controls are partially obscured, scroll bars appear.

If AutoScroll is false, scroll bars don't appear automatically. In this case, use the HorzScrollBar and VertScrollBar properties to make scroll bars appear.

If the property Stretch is set, it will take no effect.

 

Codec

Property Codec: TVNCCodec;

TVNCCodec=(vncHextile, vncCoRRE, vncRRE, vncCopyRect, vncRAW)

 

EnableBell

Property EnableBell: boolean;

Description

if EnableBell is true, the viewer will bell when the server bell.

 

FrameUpdateDelay

Property FrameUpdateDelay: Word;

Description

FrameUpdateDelay determines how frequently the viewer will request frames updating from the server in milliseconds

 

Password

Property Password: String;

description

The login password of the viewer.

 

Port

Property Port: Integer;

Description

The login Port of the viewer.

 

Server

Property Server:String;

Description

The Address the viewer will connect to.

 

RequestFrames

Property RequestFrames: Boolean;

Description

If the RequestFrames is true, the viewer will reuqest updating from the server every "RequestFramesDelay" milliseconds. Or the viewer will never update.

 

PixelFormat

Property PixelFormat: TPixelFormat;

TPixelFormat=(VNCAuto,VNC8Bit)

 

ShareDesktop

Property ShareDesktop: Boolean;

Description

If ShareDesktop is ture, the server will not disconnect other clients when the viewer logined.

 

Stretch

Property Stretch: Boolean;

Description

If Stretch is true, the remote screen will stretch to the width and height the user set. And the property AutoScroll will take no effect.

 

TransferKeys

Property TransferKeys: boolean;

Description

if TransferKeys is true, The viewer will transfer the key actions to the server.

 

TransferMouse

Property TransferMouse: boolean;

Description

if TransferMouse is true, The viewer will transfer the mouseactions to the server.

 

TransferLocalClipboard

Property TransferLocalClipboard: boolean;

Description

if TransferLocalClipboard is true, The viewer will transfer the local clipboard actions to the server.

 

TransferServerClipboard

Property TransferServerClipboard: boolean;

Description

if TransferServerClipboard is true, server will transfer the server clipboard actions to the viewer.

 

xPosition

Property xPosition: Integer;

Description

xPosition is x position of the left-top point of the remote screen Which will display in the viewer control's rectangle.

 

yPosition

Property yPosition: Integer;

Description

yPosition is yposition of the left-top point of the remote screen Which will display in the viewer control's rectangle

 

Method


The VNC Viewer Control have three method:

 

Connect

Procedure Connect;

Description

Connect to the server using the property "Server", "Port", "Password" are set.

 

Disconnect

Procedure Disconnect;

Description

Disconnect the viewer from server.

 

RequestUpdate

Procedure RequestUpdate;

Descriptio

Force the viewer to update a frame.

 

Events


The VNC Viewer control have seven special events:

 

OnAuthFail

procedure OnAuthFail(Sender: TObject)

Description

When the viewer login to server fail, the event will occur.

 

OnConnectClose

procedure OnConnectClose(Sender: TObject)

Description

When the viewer disconnect from server, the event will occur.

 

OnConnected

Procedure OnConnected(Sender: TObject)

Description

When the Viewer connected to the server, the event occurs

 

OnConnectError

Procedure OnConnectError(Sender: TObject; ErrorMsg: String);

Description

When error happened during the viewer is connecting to the server, the event occurs. The ErrorMsg is the error message.

 

OnFrameSize

Procedure OnFrameSize(Sender: TObject; FrameWidth,FrameHeight: Integer);

Description

When viewer login to server successfully, the server will return the width and height of the remote screen, then the event occurs. FrameWidth and FrameHeight are the width and height of remote screen.

 

OnHostName

Procedure OnHostname(Sender: Tobject; HostName:String);

Description

When viewer login to server successfully, the server will return the name of the remote host. HostName is the name of the remote host.

 

OnStatus

Procedure OnStatus(Sender: TObject; ErrorMsg: String);

Description

The event occurs during the login process. The ErrorMsg is the message return.

 

Example


There is an example in the folder samples. The sample project demostrate all the properties and method of the control.